import http from "@utils/request";

import { IDictAllRequest } from "@interface/dict";


type DictsItem = {
    id: string;
    typeId: string;
    k: string;
    v: string;
    sort: number;
    remark: string;
    createBy: string;
    createTime: number;
    updateBy: string | null;
    updateTime: number | null;
}

export type Dicts = {
    system_global_status: DictsItem[]
}

interface IDicts {
    code: string;
    message: string;
    data: Dicts
}

//查询字典项（批量）
export const queryBatch = (data: string[]): Promise<IDicts> => {
    return http.post<IDicts>('/system_dict_item/queryBatch', data)
}

//查询字典类型
export const dictTypeAll = (): Promise<IDictAllRequest> => {
    return http.get<IDictAllRequest>('/system_dict_type/getAll')
}
